<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            background-color: blue;
        }
    </style>
</head>
<body>
    <div>1</div>
    <div>2</div>
    <div>3</div>
    <script>
        var div = document.querySelectorAll('div');
        // 传统解绑
        div[0].onclick = function() {
            alert('e1');
            div[0].onclick = null;
        }
        // 方法监听绑定事件解绑
        div[1].addEventListener('click', fn);
        function fn() {
            alert('eee!');
            div[1].removeEventListener('click', fn);
        }
    </script>
</body>
</html>